import { CardController } from '@/game/card/cardController'
import { CardIconType } from '@/share/commonType'
import * as PIXI from 'pixi.js'

export const enum ActionType {
    None,
    Move,
    Resize
}
export const enum ResizeType {
    None,
    ResizeWidth,
    ResizeHeight,
    ResizeAll,
}

export const enum FloatWinPos {
    Middle = 'middle',
    Top = 'top',
    Bottom = 'bottom',
    Left = 'left',
    Right = 'right'
}

export interface userInfo {
    username: string,
    avatar: string,
    email: string,
    gender: string,
    nickname: string,
    password: string,
    signature: string
}

export interface FriendInfo {
    username: string,
    status: boolean,
    avatar: string,
    nickname: string,
    signature: string,
    gender?: string,
}

export interface ChatInfo {
    name: string, // 对方的username，或者好友的username
    nickname: string,
    avatar: string,
    isGroup?: boolean,
}
export interface ChatMsgInfo {
    sender: string,
    content: string,
    createdAt: string,
    contentType?: string
    receiver?: string,
}

export type AppType = PIXI.Application<PIXI.ICanvas>
export type ContainerType = PIXI.Container<PIXI.DisplayObject> | any


export interface InviteMsgType {
    sender: string;
    nickname: string;
    avatar: string;
    gameName: string;
    gameid: string;
}

export interface ButtonProps {
    container: PIXI.Container
    text: string | number
    bgColor?: string
    handler?: () => void
    posX?: number,
    posY?: number;
    width?: number
    height?: number
    scaleSize?: number
}
export interface TextAttr {
    text: string;
    color?: string;
    fontSize?: number;
    container: PIXI.Container;
    posX?: number;
    posY?: number;
    scaleSize?: number;
    fontFamily?: string
}

export interface CardProps {
    cardNum: number;
    cardIcon: CardIconType;
    container: PIXI.Container;
    controller?: CardController;
    posX?: number;
    posY?: number;
    scale?: number
    isLandCard?: boolean
}
export enum playerOrderType { //左右玩家的位置是镜像，沿着中心对称
    Before,
    After
}
export interface PlayerProps {
    playerOrder?: playerOrderType;
    baseContainer?: PIXI.Container;
    playerSprite?: PIXI.Sprite;
    posX?: number; // 锚点位置，会通过它计算出各种位置。
    posY?: number;
}

export interface AudioConfig {
    name: string,
    src: string,
    loop?: boolean,
}